﻿@model TicketMaster.Web.Models.Reservation.ReservationStepOne
@{
    ViewBag.Title = "Reservation";
}

<script type="text/javascript"
        src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>

<script type="text/javascript">
    function initialize(data) {

        var options = {
            center: new google.maps.LatLng(42.8170229, 25.0823987),
            zoom: 8,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
        };
        var map = new google.maps.Map($("#map")[0], options);
    }
    $(function () {
        var cities = @Html.Raw(Json.Encode(Model.Cities.Values.ToList()));
        initialize(cities);
    });
</script>
<div id="map" style="width:auto; height:500px; margin-top: 10px"></div>

@using (Html.BeginForm("FindRoutes", "Reservation", FormMethod.Post))
{
    @Html.ValidationSummary();

    <div class="col-md-4">
        @Html.LabelFor(x => x.FromCities, new { style = "display: block; " })
        @Html.DropDownListFor(x => x.FromCityID, Model.FromCities, "", new { style = "display: block; " })
        @Html.ValidationMessageFor(x => x.FromCityID)
    </div>

    <div class="col-md-4">
        @Html.LabelFor(x => x.ToCities, new { style = "display: block; " })
        @Html.DropDownListFor(x => x.ToCityID, Model.FromCities, "", new { style = "display: block; " })
        @Html.ValidationMessageFor(x => x.FromCityID)
    </div>

    @Html.HiddenFor(x => x.FromCities)
    <input type="submit" value="Търси" name="upload" id="uploadImage" style="display: block; margin-top: 10px;" />
}